package models;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import play.db.jpa.Model;

@Entity
public class TableRelation extends Model{

    @ManyToOne(optional=false)
    @JoinColumn(nullable = false, name = "targettableid", referencedColumnName = "id")
    public CommonTable targetTable;
    
    @ManyToOne(optional=false)
    @JoinColumn(nullable = false, name = "srctableid", referencedColumnName = "id")
    public CommonTable srcTable;
    
    @ManyToOne(optional=false)
    @JoinColumn(nullable = false, name = "authorid", referencedColumnName = "id")
    public User author;

    @ManyToOne(optional=false)
    @JoinColumn(nullable = false, name = "updaterid", referencedColumnName = "id")
    public User updater;
    
    public String remark;
    
    @ManyToOne(optional=false)
    @JoinColumn(nullable = false, name = "maintainerid", referencedColumnName = "id")
    public User maintainer;
    

    public Date createDate;
    
    public Date updateDate;
    
}
